<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <ty-header></ty-header>
        <ty-footer></ty-footer>
    </div>
    <script>

        Vue.component('ty-header',{
            template:`<div>hello world</div>`
        })

        new Vue({
            el:"#app",
            data:{
                msg:"1"
            },
            components:{
                'ty-footer':{
                    template:`<div @click='msg++'>{{msg}}</div>`,
                    data:function(){
                        return{
                            msg:"1"
                        }
                    }
                }
            }
        })
    </script>
</body>
</html>